﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RR {
    public class Global
    {

        public static bool isGameOver = false;

        public static int scoreNow;

        public static int MaxScore;

        //更改右侧颜色的value值和开关
        public static int value;
        public static bool isColor = false;
        public static int lastValue = 5;

        public static Vector3[] colorList;

        public static void GetMaxScore()
        {
            if (PlayerPrefs.HasKey("score"))
            {
                MaxScore = PlayerPrefs.GetInt("score");
            }
            else
            {
                Debug.Log("不存在最佳成绩");
            }
        }

        public static void SetMaxScore(int value)
        {
            if (PlayerPrefs.HasKey("score"))
            {
                if (PlayerPrefs.GetInt("score") < value)
                {
                    PlayerPrefs.SetInt("score", value);
                }
            }
            else
            {
                PlayerPrefs.SetInt("score", value);
            }
        }

        public static void GameOver()
        {
            Global.isGameOver = true;
        }
    }
}

